package com.ky.course.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ky.common.vo.R;
import com.ky.study.entity.OpenCourseVideo;
import com.ky.course.mapper.OpenCourseVideoMapper;
import com.ky.course.service.OpenCourseVideoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 公开课视频表 服务实现类
 * </p>
 *
 * @author zpa
 * @since 2024-06-19
 */
@Service
public class OpenCourseVideoServiceImpl extends ServiceImpl<OpenCourseVideoMapper, OpenCourseVideo> implements OpenCourseVideoService {


    @Autowired
    private OpenCourseVideoMapper openCourseVideoMapper;
    @Override
    public R getVideoList(Integer courseId) {
        QueryWrapper<OpenCourseVideo> queryWrapper = new QueryWrapper<OpenCourseVideo>().eq("course_id", courseId);
        List<OpenCourseVideo> openCourseVideos = openCourseVideoMapper.selectList(queryWrapper);
        return R.ok(openCourseVideos);
    }
}
